package bhbt.service;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import bhbt.model.Member;
import bhbt.model.TelVal;
import bhbt.service.core.BaseService;
import bhbt.utils.StringUtil;






@Service
public class TelValService extends BaseService {
	
	public TelVal executValByTel(String tel) {
		if(StringUtil.isNotBlank(tel)) {
			Map<String, Object> param = new HashMap<String, Object>();
			param.put("telNo", tel);
			List<TelVal> list = queryForList("select", param);
			if (null != list && 0 < list.size()) {
				return list.get(0);
			}
		}
		return null;
	}

	/**
	 * 查询第一个激活的人
	 * @param loginName
	 * @return
	 */
	public TelVal executLast(String tel) {
		 
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("telNo", tel);
		param.put("where"," 1=1 order By id desc ");  //排列
		List<TelVal> list = queryForList("select", param);
		 
		if(list.size()>0){
			System.out.println("****************-----------");
			return list.get(0);
		}else{
			return null;
		}
		 
		 
	}
}
